import React, { Component } from 'react'
import Header from '../common/Header'
import TabBar from '../common/TabBar'
import MySwiper from '../common/MySwiper'
import Axios from 'axios';

export default class Home extends Component {
    constructor() {
        super();
        this.state = {
            list:[]
        }
    }
    componentDidMount() {
        Axios.post('/swiper',{count:5}).then((res) =>{
            this.setState({
                list: res.data.list
            })
        })
    }
    render() {
        return (
            <div>
                {/* header */}
                <Header title={'首页'} back={'搜索'} ope={'设置'} theme="light"></Header>
                {/* 轮播图 */}
                <MySwiper list={this.state.list}></MySwiper>

                {/* tabbar */}
                <TabBar></TabBar>
            </div>
        )
    }
}
